package edu.netjava.ServerCharThread;

import java.util.ArrayList;
import java.util.List;

public class ChaterThreadStore {
	
	
	
	public static void add(ChaterDeal cd){
		list.add(cd);
	}
	
	public static void remove(){
		
		for(int i=0;i<list.size();i++){
			ChaterDeal temp = list.get(i);
			if(temp.isStop){
				list.remove(i);
			}
		}
		
	}
	
	public static void send2All(String msg){
		
		for(int i=0;i<list.size();i++){
			
			list.get(i).SendMessage(msg);
			
		}
		
	}
	
	private ChaterThreadStore(){}
	
	public static List<ChaterDeal> list = new ArrayList<ChaterDeal>();
		

}
